/**
 * Apr 2, 2011
 * 9:34:30 PM
 * Timiz
 * kukujun@gmail.com
 *cn.lastjune.dao.impltimiz-project-dpProblemDaoImpl
 */
package cn.lastjune.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import cn.lastjune.dao.ProblemDao;
import cn.lastjune.pojo.Problem;
import cn.lastjune.util.Page;

/**
 * @author Timiz
 *         kukujun@gmail.com
 */
@Repository
public class ProblemDaoImpl extends HibernateDao<Problem, String> implements ProblemDao
{

    /*
     * (non-Javadoc)
     * @see cn.lastjune.dao.ProblemDao#getByEventcauseid(java.lang.String)
     */
    @Override
    public Problem getByEventcauseid(String eventcauseid)
    {
        return this.get(eventcauseid);
    }

	@Override
	public List<Problem> getAllByFilter(String type,String filter) {
		final String sql = "from Problem p where p."+type+" like '%"+filter+"%'";
    	return this.getSession().createQuery(sql).list();
	}

}
